package org.jim.core.packets;

/**
 * <pre>
 **
 * 聊天类型
 * </pre>
 */
public enum GroupMemberType {
  /**
   * <pre>
   * 普通用户
   * </pre>
   *
   * <code>ROLE_PUBLIC = 0;</code>
   */
  ROLE_PUBLIC(0),
  /**
   * <pre>
   * 管理员
   * </pre>
   *
   * <code>ROLE_ADMIN = 1;</code>
   */
  ROLE_ADMIN(1),
  /**
   * <pre>
   * 群主
   * </pre>
   *
   * <code>ROLE_OWNER = 2;</code>
   */
  ROLE_OWNER(2),
  ;

  public final int getNumber() {
    return value;
  }

  public static GroupMemberType valueOf(int value) {
    return forNumber(value);
  }

  public static GroupMemberType forNumber(int value) {
    switch (value) {
      case 0: return ROLE_PUBLIC;
      case 1: return ROLE_ADMIN;
      case 2: return ROLE_OWNER;
      default: return null;
    }
  }

  private final int value;

  GroupMemberType(int value) {
    this.value = value;
  }
}

